/*大字幕&自动断句*/
mparent=document.querySelector('body')
mainele=document.querySelector('body').querySelectorAll('contact,date,time,content,h1,h2,h3,h4,h5,h6,highlight,question,qs,span,th,td,a,i,b,u,p,l,s,li,text')
function breaksent_start(){var eleleng=mainele.length;for(i=0;i<eleleng;i++){breaksent(mainele[i]);};}
function breaksent(ele){
a=ele.innerHTML;a="<sentence>"+a+"</sentence>";
/*标点：断*/a=a.replace(/，/gi,"，</sentence><sentence>");a=a.replace(/。/gi,"。</sentence><sentence>");a=a.replace(/：/gi,"：</sentence><sentence>");a=a.replace(/；/gi,"；</sentence><sentence>");a=a.replace(/！/gi,"！</sentence><sentence>");a=a.replace(/？/gi,"？</sentence><sentence>");a=a.replace(/\n/gi,"\n</sentence><sentence>");
/*标点：终*/a=a.replace(/）/gi,"）</sentence><sentence>");a=a.replace(/》/gi,"》</sentence><sentence>");a=a.replace(/】/gi,"】</sentence><sentence>");a=a.replace(/」/gi,"」</sentence><sentence>");a=a.replace(/、/gi,"、</sentence><sentence>");a=a.replace(/”/gi,"”</sentence><sentence>");a=a.replace(/’/gi,"’</sentence><sentence>");a=a.replace(/——/gi,"——</sentence><sentence>");
/*标点：起*/a=a.replace(/（/gi,"</sentence><sentence>（");a=a.replace(/【/gi,"</sentence><sentence>【");a=a.replace(/「/gi,"</sentence><sentence>「");a=a.replace(/《/gi,"</sentence><sentence>《");a=a.replace(/“/gi,"</sentence><sentence>“");a=a.replace(/‘/gi,"</sentence><sentence>‘");
/*细节处理*/a=a.replace(/<br\/>/gi,'</sntence><br/><sentence>');a=a.replace(/<br>/gi,'</sentence><br/><sentence>');a=a.replace(/<sentence><\/sentence>/gi,"");a=a.replace(/<sentence>[ \n]+<\/sentence>/gi,"");a=a.replace(/<\/sentence><sentence>”<\/sentence>/gi,"”</sentence>");a=a.replace(/<sentence><sentence>/gi,"<sentence>");a=a.replace(/<sentence><pre>/gi,"<pre>");a=a.replace(/<\/pre><\/sentence>/gi,"</pre>");a=a.replace(/<\/sentence><\/sentence>/gi,"</sentence>");a=a.replace(/”<\/sentence><sentence>：<\/sentence><sentence>“/gi,"”：“");
ele.innerHTML=a;
/*a=a.replace(/……/gi,"……</sentence><sentence>");a=a.replace(/～/gi,"～</sentence><sentence>");*/
}
function breaksent_stop(){mparent.innerHTML=mparent.innerHTML.replace(/<sentence>/gi,'').replace(/<\/sentence>/gi,'');wza_breaksent=false;}
breaksent_start();
/*大字幕*/
function subt_start(){
	var wza_subtitle=document.createElement('div');
	wza_subtitle.id='wza_subtitle';
	wza_subtitle.innerText="大字幕辅助已启用";
	$('body').appendChild(wza_subtitle);
	cfg=".replace(/\\n/gi,'　')";
	var count=document.querySelectorAll('sentence,button').length;
	for(var a=0;a<count;a++){document.querySelectorAll('sentence,button')[a].addEventListener('mouseover',function(){wza_subtitle.innerText=document.querySelector('sentence:hover,button:hover').innerText})}
	var icount=document.querySelectorAll('input,textarea').length;
	for(var a=0;a<icount;a++){document.querySelectorAll('input,textarea')[a].addEventListener('mouseover',function(){wza_subtitle.innerText=document.querySelector('input:hover,textarea:hover').value})}
}
/*朗读*/
function tts_start(){
	var count=document.querySelectorAll('sentence,button').length;
	for(var a=0;a<count;a++){document.querySelectorAll('sentence,button')[a].addEventListener('mouseover',function(){wza_say(document.querySelector('sentence:hover,button:hover').innerText)})}
	var icount=document.querySelectorAll('input,textarea').length;
	for(var a=0;a<icount;a++){document.querySelectorAll('input,textarea')[a].addEventListener('mouseover',function(){wza_say(document.querySelector('input:hover,textarea:hover').value)})}
}